{CI} Refactor git hooks to improve cross-platform compatibility#30882
{CI} Refactor git hooks to improve cross-platform compatibility#30882wangzelin007 merged 2 commits intoAzure:devfrom
Conversation
Update pre-commit and pre-push hooks to support both Windows and Unix-like systems.
Update pre-push PowerShell script to use Read-Host for input and provide a default 'Y' response when no input is given
️✔️AzureCLI-FullTest
|
|
Hi @wangzelin007, |
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
| Write-Host "Would you like to automatically rebase and setup? [Y/n]" -ForegroundColor Yellow | ||
|
|
||
| try { | ||
| $reader = [System.IO.StreamReader]::new("CON") |
There was a problem hiding this comment.
CON relies on the .NET framework, so replace it with the more generic Read-Host
| ) | ||
| exit /b %errorlevel% | ||
| # Check if running in Windows | ||
| if [ -n "$COMSPEC" ]; then |
There was a problem hiding this comment.
it "specifies" the command interpreter, which by default is cmd.exe in Windows
…e#30882) * {CI} Refactor git hooks to improve cross-platform compatibility Update pre-commit and pre-push hooks to support both Windows and Unix-like systems. * {CI} Improve input handling in pre-push git hook Update pre-push PowerShell script to use Read-Host for input and provide a default 'Y' response when no input is given
Update pre-commit and pre-push hooks to support both Windows and Unix-like systems.Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.